<%@ page contentType="text/html;charset=UTF-8" language="java" import="com.scalar.chiptrack.utils.ConfigManager"%>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/operations/product_setup.jsp"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<HTML><HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>

<script>
function func()
{
	var pa=document.getElementById("message");
	var product_name = trim(document.productsetup.baseProductName.value);
	if(product_name=='')
	{
		product_name='';
		pa.innerHTML = "Please Enter Base Product Name ...";
		return;
	}
    if( product_name.indexOf('"') >= 0 )
    {
        pa.innerHTML = "Base Product Name cannot contain Double Quotes...";
        document.productsetup.baseProductName.select();
        document.productsetup.baseProductName.focus();
		return;
    }
    if( product_name.indexOf("'") >= 0 )
    {
        pa.innerHTML = "Base Product Name cannot contain Single Quotes...";
        document.productsetup.baseProductName.select();
        document.productsetup.baseProductName.focus();
		return;
    }
	document.productsetup.baseProductName.value = product_name;
	document.productsetup.submit();
}

function cancel() {
	document.productsetup.action ="<%=chipTracContext%>/baseProductList.do";
	document.productsetup.submit();
}

function reset() {
	document.productsetup.reset();
}

function notAllowedSpecialChars()
{
    var pa=document.getElementById("message");
    var validKeys = "0123456789-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var keyCode = window.event.keyCode;
    if ( validKeys.indexOf( String.fromCharCode(keyCode) ) != -1)
    {
        pa.innerHTML = "";
        event.returnValue = true;
    }
    else
    {
        pa.innerHTML = "Base Product Name allows alphanumeric, -, _ only";
        event.returnValue = false;
    }
}
</script>

<TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type='text/css' rel='stylesheet'>
</HEAD>
<BODY bgColor='#ffffff' leftMargin='0' topMargin='0' marginheight="0" marginwidth="0">

<html:form name="productsetup" type="com.scalar.chiptrack.operations.process.forms.ProductSetupForm" action="/productsetup">                 

<!-- Top Header Start-->

<%@include file="/jsp/includes/header.jsp"%>

<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

<%@include file="/jsp/operations/product_menu.jsp"%>

	</TD>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->


<center><span class="NArialW">New Process</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

<% String message = (String)request.getAttribute("message");
   if(message==null)
   message=""; %>
<center>
<strong><font class="NArialL"><font color="FF0000"><font id="message"></font></font></font>
</center>
<table border="0" width="90%" align=right>

 <% if(!message.equals("")){ %>	
	<tr>
		<td colspan=2 align="left"><strong><font class="NArialL"><font color="FF0000"><%=message%></font></font></td>
	</tr>
<% } %>

  <tr>
    <td width="10%"><font class="NArialL">Base Product Name</font></td>
    <td width="30%"><!-- <input type="text" name="baseProductName" size="25" class="txfield"> -->
	<html:text name="productsetup" property="baseProductName" size="25" styleClass="txfield" maxlength="50" onkeypress="notAllowedSpecialChars()"/>
	</td>
   </tr>
   <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
   <tr>
    <td width="10%"><font class="NArialL">Comments</font></td>
    <td width="30%">
		<html:textarea  name="productsetup" property="comments" styleClass="txfield" cols="40" rows="4"/>
		<!-- <textarea rows="5" name="comments" cols="40" class="txfield"></textarea> -->
	</td>
  </tr>
  <tr><td colspan=2><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="20"></td></tr>
  <tr>
    <td colspan=2 align='center'>
    <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:func();' onmouseover="window.status='Click here to save this Base Product';return true" onmouseout="window.status='';return true">
	<img border="0" src="<%=chipTracContext%>/jsp/includes/images/next.gif" width="53" height="17"></chiptrack:restrictedLink>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:reset();' onmouseover="window.status='Click here to reset the page';return true" onmouseout="window.status='';return true">
    <img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17"></chiptrack:restrictedLink>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	 <chiptrack:restrictedLink functionality='<%=Functionality.PRODUCT_SETUP%>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:cancel();' onmouseover="window.status='Click here to return to Product List';return true" onmouseout="window.status='';return true">
    <img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17"></chiptrack:restrictedLink>
  </tr>

</table>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->

<%@include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->
</html:form>
</BODY>
</html>